home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.2 Development Libraries / SGI IRIX 6.2 Development Libraries.iso / dist / complib.idb / usr / share / catman / p_man / cat3 / complib / fft2du.z / fft2du
Text File  |  1996-03-14  |  8KB  |  133 lines

  1.  
  2.  
  3.  
  4. ssssccccfffffffftttt2222dddduuuu,,,,ddddzzzzfffffffftttt2222dddduuuu((((3333FFFF))))                                    ssssccccfffffffftttt2222dddduuuu,,,,ddddzzzzfffffffftttt2222dddduuuu((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ssssccccfffffffftttt2222dddduuuu,,,, ddddzzzzfffffffftttt2222dddduuuu ---- 2D, Real to Complex, Direct Fast Fourier Transforms.
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS
  12.      _F_o_r_t_r_a_n :
  13.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ssssccccfffffffftttt2222dddduuuu(((( ssssiiiiggggnnnn,,,, nnnn1111,,,, nnnn2222,,,, aaaarrrrrrrraaaayyyy,,,, llllddddaaaa,,,, ccccooooeeeeffff ))))
  14.           iiiinnnntttteeeeggggeeeerrrr            ssssiiiiggggnnnn,,,, nnnn1111,,,, nnnn2222,,,, llllddddaaaa
  15.           rrrreeeeaaaallll      aaaarrrrrrrraaaayyyy((((llllddddaaaa,,,,nnnn2222)))),,,, ccccooooeeeeffff((((((((nnnn1111++++11115555))))++++2222****((((nnnn2222++++11115555))))))))
  16.  
  17.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ddddzzzzfffffffftttt2222dddduuuu(((( ssssiiiiggggnnnn,,,, nnnn1111,,,, nnnn2222,,,, aaaarrrrrrrraaaayyyy,,,, llllddddaaaa,,,, ccccooooeeeeffff ))))
  18.           iiiinnnntttteeeeggggeeeerrrr            ssssiiiiggggnnnn,,,, nnnn1111,,,, nnnn2222,,,, llllddddaaaa
  19.           rrrreeeeaaaallll****8888  aaaarrrrrrrraaaayyyy((((llllddddaaaa,,,,nnnn2222)))),,,, ccccooooeeeeffff((((((((nnnn1111++++11115555))))++++2222****((((nnnn2222++++11115555))))))))
  20.  
  21.  
  22.      _C :
  23.      ####iiiinnnncccclllluuuuddddeeee <<<<fffffffftttt....hhhh>>>>
  24.      iiiinnnntttt ssssccccfffffffftttt2222dddduuuu (((( iiiinnnntttt ssssiiiiggggnnnn,,,, iiiinnnntttt nnnn1111,,,, iiiinnnntttt nnnn2222,,,, ffffllllooooaaaatttt ****aaaarrrrrrrraaaayyyy,,,,
  25.                     iiiinnnntttt llllddddaaaa,,,, ffffllllooooaaaatttt ****ccccooooeeeeffff))));;;;
  26.      iiiinnnntttt ddddzzzzfffffffftttt2222dddduuuu (((( iiiinnnntttt ssssiiiiggggnnnn,,,, iiiinnnntttt nnnn1111,,,, iiiinnnntttt nnnn2222,,,, ddddoooouuuubbbblllleeee ****aaaarrrrrrrraaaayyyy,,,,
  27.                     iiiinnnntttt llllddddaaaa,,,, ddddoooouuuubbbblllleeee ****ccccooooeeeeffff))));;;;
  28.  
  29.  
  30. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  31.      ssssccccfffffffftttt2222dddduuuu and ddddzzzzfffffffftttt2222dddduuuu compute in place the complex Fourier transform of
  32.      real 2D sequence of size N1 x N2.  The value F{k,l} of the transform of
  33.      the 2D sequence f{i,j} is equal to:
  34.           F{k,l} = Sum ( W1^(i*k) * W2^(j*l) * f{i,j} ),
  35.                   for i =0,...,(N1-1), j=0,...,(n2-1)
  36.               W1 = exp( (Sign*2*sqrt(-1)*PI) / N1 )
  37.               W2 = exp( (Sign*2*sqrt(-1)*PI) / N2 )
  38.  
  39.  
  40. SSSSttttoooorrrraaaaggggeeee
  41.      It is assumed that the (N1 x N2) 2D sequence is stored along dimension
  42.      N1.  So the index {i+1,j} has an offset of 1 element with respect to
  43.      {i,j}, and {i,j+1} an offset of _l_d_a elements with respect to {i,j}.
  44.      NNNNOOOOTTTTEEEE :::: lda must be larger (or equal) to 2*((N1+2)/2).
  45.  
  46.  
  47. AAAAllllggggoooorrrriiiitttthhhhmmmm
  48.      The real-to-complex Direct 2D Fourier transform is computed with a row-
  49.      column approach.
  50.       - First, N2 FFTs real-to-complex of size N1 are evaluated, stride = 1
  51.       and leading_dimension=lda.
  52.       - then, N1 FFTs complex-to-complex of size N2 are preformed,
  53.      stride=lda/2, and leading_dimension=1.
  54.  
  55.      As the input sequence has real values, only half of the results are
  56.      computed since the sample {(N1-k),l} of the real-to-complex transform
  57.      would be the conjugate of the sample {k,l}.
  58.      However, some extra space is necessary, and the relation
  59.      (lda>=2*((N1+2)/2)) must hold.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssccccfffffffftttt2222dddduuuu,,,,ddddzzzzfffffffftttt2222dddduuuu((((3333FFFF))))                                    ssssccccfffffffftttt2222dddduuuu,,,,ddddzzzzfffffffftttt2222dddduuuu((((3333FFFF))))
  71.  
  72.  
  73.  
  74. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  75.      SSSSIIIIGGGGNNNN Integer specifying which sign to be used for the expression of W
  76.      (see above) - must be either +1 or -1.
  77.      Unchanged on exit.
  78.  
  79.      NNNN1111 Integer, the first dimension size of the 2D sequence.
  80.      Unchanged on exit.
  81.  
  82.      NNNN2222 Integer, the second dimension size of the 2D sequence.
  83.      Unchanged on exit.
  84.  
  85.      AAAARRRRRRRRAAAAYYYY Array containing the samples of the 2D sequence to be transformed.
  86.      On input, the element {i,j} of the sequence is stored as A(i,j) in
  87.      _F_o_r_t_r_a_n , and A[i+j*lda] in _C.
  88.      On exit, the array is overwritten by its transform.
  89.  
  90.      LLLLDDDDAAAA Integer, leading dimension: increment between the samples of two
  91.      consecutive sub-sequences (e.g between {i,j+1} and {i,j} ).
  92.      Unchanged on exit.
  93.  
  94.      CCCCOOOOEEEEFFFFFFFF Array of at least ( (N+15)+2*(N2+15) ) elements.  On entry it
  95.      contains the Sines/Cosines and factorization of N. COEFF needs to be
  96.      initialized with a call to scfft2dui or dzfft2dui.       Unchanged on
  97.      exit.
  98.  
  99.  
  100. EEEExxxxaaaammmmpppplllleeee ooooffff CCCCaaaalllllllliiiinnnngggg SSSSeeeeqqqquuuueeeennnncccceeee
  101.      2D FFTs computed on a 64*1024 sequence of real values. The elements of
  102.      each sequence are stored with increment (stride) 1, and the offset
  103.      between the first element of two succesive sequence (leading dimension)
  104.      is 1026.
  105.      Note : 1026 >= 1024+2 .
  106.      _F_o_r_t_r_a_n
  107.           real array(0:1026-1,0:64-1), coeff(1024+15 + 2*(64+15))
  108.           call scfft2dui( 1024, 64, coeff)
  109.           call scfft2du( -1, 1024, 64, array, 1026, coeff)
  110.  
  111.      _C
  112.           #include <fft.h>
  113.           float array[64*1026], *coeff;
  114.           coeff = scfft2dui( 1024, 64, NULL);
  115.           scfft2du( -1, 1024, 64, array, 1026, coeff);
  116.  
  117. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  118.      fft, scfft2dui, dzfft2dui, scfft1du, dzfft1du, csfft2du, zdfft2du
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.